package com.yanqu.road.entity.activity.daomu.pvp;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

/**
 * pvp活动数据
 */
@FieldTypeAnnotation(tableName = "t_c_activity_daomu_pvp_data")
public class DaoMuPvpData extends DataObject {

    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;

    @FieldTypeAnnotation(desc = "当前轮次")
    private int round;

    @FieldTypeAnnotation(desc = "锁定状态，每轮重置")
    private boolean lockState;

    @FieldTypeAnnotation(desc = "累计进入xx层人数，每轮重置")
    private Map<Integer, Integer> floorCntMap = new ConcurrentHashMap<>();

    @FieldTypeAnnotation(desc = "淘汰模式，每轮重置")
    private boolean disuse;

    @FieldTypeAnnotation(desc = "是否结算，每轮重置")
    private boolean settle;

    // 已坍塌层数,不入库了
    private Set<Integer> collapseFloors = new HashSet<>();


    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public boolean isLockState() {
        return lockState;
    }

    public void setLockState(boolean lockState) {
        if (this.lockState != lockState) {
            this.lockState = lockState;
            setOp(DataStatus.Update);
        }
    }

    public int getRound() {
        return round;
    }

    public void setRound(int round) {
        if (this.round != round) {
            this.round = round;
            setOp(DataStatus.Update);
        }
    }

    public Map<Integer, Integer> getFloorCntMap() {
        return floorCntMap;
    }

    public void setFloorCntMap(Map<Integer, Integer> floorCntMap) {
        if (floorCntMap == null) {
            return;
        }
        this.floorCntMap = floorCntMap;
        setOp(DataStatus.Update);
    }

    public boolean isDisuse() {
        return disuse;
    }

    public void setDisuse(boolean disuse) {
        if (this.disuse != disuse) {
            this.disuse = disuse;
            setOp(DataStatus.Update);
        }
    }

    public boolean isSettle() {
        return settle;
    }

    public void setSettle(boolean settle) {
        if (this.settle != settle) {
            this.settle = settle;
            setOp(DataStatus.Update);
        }
    }

    public Set<Integer> getCollapseFloors() {
        return collapseFloors;
    }

    public void setCollapseFloors(Set<Integer> collapseFloors) {
        this.collapseFloors = collapseFloors;
    }
}
